import http from "@/utils/http";




export const getRuleTradeGoodsSimulationApi = () => {
  return http({
    url: "trade/tradeGoodsSimulation/getRule",
    method:"GET"
  }
  )
};


export const saveAllRuleTradeGoodsSimulationApi = (form) => {
  return http({
    url: "trade/tradeGoodsSimulation/saveAllRule",
    method: "PUT",
    data: form
  })
}

export const getCategoryFirByParamsApi = (queryPageParams) => {
  return http({
    url: "trade/tradeGoodsSimulation/getCategoryFirByParams",
    method: "POST",
    data: {
      start: queryPageParams.dateTime[0],
      end: queryPageParams.dateTime[1],
      categoryFirId: queryPageParams.categoryFirId,
      categorySecId: queryPageParams.categorySecId,
      saleType: queryPageParams.saleType,
      customerId: queryPageParams.customerId,
      goodsId: queryPageParams.goodsId,
      simulationGoodsList: queryPageParams.simulationGoodsList,
      customerLine: queryPageParams.customerLine
    }
  })
}


export const getCategorySecByParamsApi = (queryPageParams) => {
  return http({
    url: "trade/tradeGoodsSimulation/getCategorySecByParams",
    method: "POST",
    data: {
      start: queryPageParams.dateTime[0],
      end: queryPageParams.dateTime[1],
      categoryFirId: queryPageParams.categoryFirId,
      categorySecId: queryPageParams.categorySecId,
      saleType: queryPageParams.saleType,
      customerId: queryPageParams.customerId,
      goodsId: queryPageParams.goodsId,
      simulationGoodsList: queryPageParams.simulationGoodsList,
      customerLine: queryPageParams.customerLine
    }
  })
}

export const getCategoryListByParamsApi = (queryPageParams) => {
  return http({
    url: "trade/tradeGoodsSimulation/getCategoryListByParams",
    method: "POST",
    data: {
      start: queryPageParams.dateTime[0],
      end: queryPageParams.dateTime[1],
      categoryFirId: queryPageParams.categoryFirId,
      categorySecId: queryPageParams.categorySecId,
      saleType: queryPageParams.saleType,
      customerId: queryPageParams.customerId,
      goodsId: queryPageParams.goodsId,
      simulationGoodsList: queryPageParams.simulationGoodsList,
      customerLine: queryPageParams.customerLine
    }
  })
}


export const getCustomerDataBySaleTypeApi = (queryPageParams) => {
  return http({
    url: "trade/tradeGoodsSimulation/getCustomerDataBySaleType",
    method: "POST",
    data: {
      start: queryPageParams.dateTime[0],
      end: queryPageParams.dateTime[1],
      categoryFirId: queryPageParams.categoryFirId,
      categorySecId: queryPageParams.categorySecId,
      saleType: queryPageParams.saleType,
      customerId: queryPageParams.customerId,
      goodsId: queryPageParams.goodsId,
      simulationGoodsList: queryPageParams.simulationGoodsList,
      customerLine: queryPageParams.customerLine
    }
  })
}

export const getCustomerListByParamsApi = (queryPageParams) => {
  return http({
    url: "trade/tradeGoodsSimulation/getCustomerListByParams",
    method: "POST",
    data: {
      start: queryPageParams.dateTime[0],
      end: queryPageParams.dateTime[1],
      categoryFirId: queryPageParams.categoryFirId,
      categorySecId: queryPageParams.categorySecId,
      saleType: queryPageParams.saleType,
      customerId: queryPageParams.customerId,
      goodsId: queryPageParams.goodsId,
      simulationGoodsList: queryPageParams.simulationGoodsList,
      customerLine: queryPageParams.customerLine
    }
  })
}


export const getGoodsListByParamsApi = (queryPageParams) => {
  return http({
    url: "trade/tradeGoodsSimulation/getGoodsListByParams",
    method: "POST",
    data: {
      start: queryPageParams.dateTime[0],
      end: queryPageParams.dateTime[1],
      categoryFirId: queryPageParams.categoryFirId,
      categorySecId: queryPageParams.categorySecId,
      saleType: queryPageParams.saleType,
      customerId: queryPageParams.customerId,
      goodsId: queryPageParams.goodsId,
      simulationGoodsList: queryPageParams.simulationGoodsList,
      customerLine: queryPageParams.customerLine
    }
  })
}

export const getOrderDetailByParamsApi = (queryPageParams) => {
  return http({
    url: "trade/tradeGoodsSimulation/getOrderDetailByParams",
    method: "POST",
    data: {
      start: queryPageParams.dateTime[0],
      end: queryPageParams.dateTime[1],
      categoryFirId: queryPageParams.categoryFirId,
      categorySecId: queryPageParams.categorySecId,
      saleType: queryPageParams.saleType,
      customerId: queryPageParams.customerId,
      goodsId: queryPageParams.goodsId,
      simulationGoodsList: queryPageParams.simulationGoodsList,
      customerLine: queryPageParams.customerLine
    }
  })
}

export const getTitileByParamsApi = (queryPageParams) => {
  return http({
    url: "trade/tradeGoodsSimulation/getTitileByParams",
    method: "POST",
    data: {
      start: queryPageParams.dateTime[0],
      end: queryPageParams.dateTime[1],
      categoryFirId: queryPageParams.categoryFirId,
      categorySecId: queryPageParams.categorySecId,
      saleType: queryPageParams.saleType,
      customerId: queryPageParams.customerId,
      goodsId: queryPageParams.goodsId,
      simulationGoodsList: queryPageParams.simulationGoodsList,
      customerLine: queryPageParams.customerLine
    }
  })
}
